package com.c2.web.front;

import com.c2.entity.EbUser;
import com.c2.service.UserRegisterService;
import com.c2.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/register")
public class RegisterController {
    @Autowired
    private UserService userService;

    @RequestMapping("/re")
    public String re(){
        return "register";
    }

    @RequestMapping("/to save")
    public  String toSave(EbUser ebUser){
        System.out.println(ebUser);
        Integer result=userService.save(ebUser);
        if(result<1) {
            return "register";
        }
        return "reg-result";
    }

}
